<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />




<div class="t_bar"><span class="color_red">*</span>实验室现状<span style="font-size: 12px;font-weight: normal;">（提示：此项内容将作为项目立项后任务书的考核指标）</span> </div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	    cellspacing="1">
    <tr class="li_2">
        <td align="left"><strong>1、实验室现状</strong>（限1000字）</td>
    </tr>
    <tr class="li_1">
        <td>
			<textarea rows="7" cols="150"  class="input_textarea required maxlength:1000"   name='proposal/goal/summary1'  label="实验室现状"><x:out select="$xmlData/data/proposal/goal/summary1"/></textarea>
		</td>
    </tr>
    <tr class="li_2">
        <td align="left"><strong>2、主要申请理由</strong>（限1000字）</td>
    </tr>
    <tr class="li_1">
        <td>
			<textarea rows="7" cols="150" name='proposal/goal/summary2' class="input_textarea required maxlength:1000"    label="主要申请理由"><x:out select="$xmlData/data/proposal/goal/summary2"/></textarea>
	    </td>
    </tr>
    <tr class="li_2">
          <td align="left"><strong>3、预期绩效目标</strong>（限1000字）</td>
    </tr>
    <tr class="li_1">
        <td>
			<textarea rows="7" cols="150" name='proposal/goal/summary3'   class="input_textarea required maxlength:1000"   label="预期绩效目标"><x:out select="$xmlData/data/proposal/goal/summary3"/></textarea>
		</td>
    </tr>
</table>		
<br>


<div class="t_bar">
	<span class="color_red">*</span>项目采购方式和内容
</div>
<table class="t_css table01" width="100%" border="0" cellpadding="0"
	id="tblPurchases" cellspacing="1">
    <thead>
		<tr>
		    <th class="TblHead" align="center" width="20px">选择</th>
			<th class="TblHead" align="center" width="20px">序号</th>
			<th class="TblHead" align="center" width="20px">采购内容</th>
			<th class="TblHead" align="center" width="20px">数量</th>
			<th class="TblHead" align="center" width="80px">单价（元） </th>
			<th class="TblHead" align="center" width="80px">金额（万元） </th>
			<th class="TblHead" align="center" width="80px">采购方式 </th>
		</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td>&nbsp;
							<input type="radio" class="radiobutton" name="selPurchases" >
						</td>
						<td>&nbsp;
							<span name="purchases|purchase[0]@seq_no" >[index]</span> 
						</td>
						<td>&nbsp;
							<input type="text" size="15" name="purchases|purchase[0]|name" class="input_text" maxlength=50 label="采购内容" value="" />
						</td>
						<td>&nbsp;
							<input type="text" size="15" name="purchases|purchase[0]|num" class="input_text" maxlength=50 label="数量" value="" onfocus="InitInput.setNumber(this,7,0,0)" />
						</td>
						<td>&nbsp;
							<input type="text" size="15" name="purchases|purchase[0]|price" class="input_text" maxlength=50 label="单价（元）" onfocus="InitInput.setNumber(this,7,4,4)"  value="" />
						</td>
						<td>&nbsp;
							<input type="text" size="15" name="purchases|purchase[0]|money" class="input_text" maxlength=50 label="金额（万元）" onfocus="InitInput.setNumber(this,7,4,4)"  value="" />
						</td>
						<td>&nbsp;

						    <select id="ciagoutype_[0]" onChange="myinitControlValue(this.id)"><option value=""></option></select>
			                <input type="hidden" id="ciagoutype_[0]_value" name="purchases|purchase[0]|ciagoutype_value" class="" label="采购方式" />
			                <input type="hidden" id="ciagoutype_[0]_name" name="purchases|purchase[0]|ciagoutype_name"  /> 
						</td>
					</tr>
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/purchases/purchase" var="purchase">
					<c:choose>
						<c:when test="${index<10}" >
						<c:set value="0" var="flag" scope="page"/>
						</c:when>
						<c:otherwise>
						<c:set value="" var="flag" scope="page"/>
						</c:otherwise>
					</c:choose>
					<tr>
						<td>&nbsp;
							<input type="radio" class="radiobutton" name="selPurchases" >
						</td>
						<td>
							<span name="purchases/purchase[${flag}${index}]@seq_no" >${index+1}</span> 
						</td>
						<td>&nbsp;
							<input type="text"  name="purchases/purchase[${flag}${index}]/name" 
							class="input_text" maxlength=50 label="采购内容"  size="15"
							value="<x:out select="$purchase/name" />" />
						</td>
						<td>&nbsp;
							<input type="text"  name="purchases/purchase[${flag}${index}]/num" 
							class="input_text" maxlength=50 label="数量"  size="15"
							value="<x:out select="$purchase/num" />" />
						</td>
						<td>&nbsp;
							<input type="text" name="purchases/purchase[${flag}${index}]/price" 
							class="input_text" maxlength=50 label="单价（元）"  size="15"
							value="<x:out select="$purchase/price" />" />
						</td>
						<td>&nbsp;
							<input type="text" name="purchases/purchase[${flag}${index}]/money" 
							class="input_text" maxlength=50 label="金额（万元）" size="15"
							value="<x:out select="$purchase/money" />" />
						</td>
						<td>&nbsp;
							<select id="ciagoutype_[${flag}${index}]" onChange="myinitControlValue(this.id)"><option value=""></option></select>
			                <input type="hidden"  id="ciagoutype_[${flag}${index}]_value" name="purchases/purchase[${flag}${index}]/ciagoutype_value" class="" label="采购方式" value="<x:out select="$purchase/ciagoutype_value" />"/>
			                <input type="hidden"  id="ciagoutype_[${flag}${index}]_name" name="purchases/purchase[${flag}${index}]/ciagoutype_name"  value="<x:out select="$purchase/ciagoutype_name" />"/>
						</td>
					
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("tblShareholders");
					</script>
				</tbody>
			</table>
			<br>
			<table width="98%" align="center">
				<tr>
					<td>
					
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('tblPurchases');showDateTag('tblPurchases');try{loadAttachType('tblPurchases', 'caigou_type', '');top.resizeFrame();}catch(e){};">
					<!-- 
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblShareholders',3,'只能填写3名主要股东')){addNewRow('tblShareholders');}showDateTag('tblShareholders');try{top.resizeFrame();}catch(e){};">
					 -->
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblPurchases','selPurchases')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblPurchases','selPurchases')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblPurchases','项目采购方式和内容')">
					</td>
				</tr>
	        </table>



<script type="text/javascript">
$(document).ready(function(){
	 var key="caigou_type";
	 $("#tblPurchases tr:gt(1)").each(function(){
		 var obj=$(this).find('td').find("select");
		 var selectid=changeString(obj.attr("id"));
		 
		 var value=$("#"+selectid).parent().children("input[id$='"+selectid+"_value'][type='hidden']").val();
		 loadAjaxSelect(selectid,"/egrantweb/cpt/ajaxload-select",{"locale":"zh_CN","key":key,"cacheable":"false","sqlParamVal":""},value);    		 
	 });
	 $("#prpInfo tr:even").addClass("li_1");
	 $("#prpInfo tr:odd").addClass("li_2");
	 $("#sp").addClass("li_2");
});


</script>
